/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ericsson.nfc.signing;

import com.ericsson.nfc.signing.certificate.CertificateChain;

/**
 *
 * @author emarkki
 */
public class SignatureStatus {
    
    private boolean valid;
    private String errorMessage;
    private CertificateChain chain;

    private SignatureStatus(boolean valid, String errorMessage, CertificateChain chain) {
        this.valid = valid;
        this.errorMessage = errorMessage;
        this.chain = chain;
    }
    
    public static SignatureStatus valid(CertificateChain chain) {
        return new SignatureStatus(true, "", chain);
    }
    
    public static SignatureStatus invalid(String errorMessage) {
        return new SignatureStatus(false, errorMessage, null);
    }

    public CertificateChain getCertificateChain() {
        return chain;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public boolean isValid() {
        return valid;
    }
       
}
